
import { getList,del,deleteAll } from '../../service/userinfo/userinfo';


import { reactive } from 'vue';

type TableType = {
  columns: Array<ColumnType>,
  loadData: Function,
  delete?: Function,
  type?: Function,
  state?: Function,
  deleteAll?: Function,
  pageConfig?: PageConfig,
  searhParams?: any,
  isSelection?: boolean,
  dialogVisible?: any
}

type ColumnType = {
  prop: string,
  label: string,
  slot?: boolean,
  attrs?: any,
  image?: boolean,
  images?: boolean
  timeFormat?: string | undefined,
  state?: boolean,
}
type PageConfig = {
  psize?: number,
  isShow?: boolean,
  pageSizes?: number[],
}
export const tableConfig = reactive<TableType>({
  loadData: getList,
  delete:del,
  deleteAll:deleteAll,
  columns:  [{
    prop: "id",
    label: "id",
    attrs: { width:80 }
  },
  {
    prop: "photo",
    label: "头像",
    slot: true,
    attrs: { width:80 }

  },
  {
    prop: "name",
    label: "姓名"
  },
  {
    prop: "usertypeName",
    label: "类型"
  },
  {
    prop: "cardid",
    label: "身份证号"
  },
  {
    prop: "sex",
    label: "性别"
  },
  {
    prop: "mobile",
    label: "手机号"
  },
  {
    prop: "usernative",
    label: "籍贯"
  },
  {
    prop: "nation",
    label: "民族"
  },
  {
    prop: "building",
    label: "小区",
    attrs: { minWidth:200 }
  },
  {
    prop: "houseno",
    label: "房间号"

  },
  {
    prop: "operate",
    label: "操作",
    slot: true,
    attrs: { width:180,fixed: "right" }
  }
  ]
})
